package com.uphone.kingmall.activity.personal;

import android.graphics.Color;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.lzy.okgo.model.HttpParams;
import com.uphone.kingmall.activity.ShopDetailActivity;
import com.uphone.kingmall.adapter.AttentionStoreAdapter;
import com.uphone.kingmall.base.BaseSearchListActivity;
import com.uphone.kingmall.bean.UserShopCollectBean;
import com.uphone.kingmall.utils.CommonUtil;
import com.uphone.kingmall.utils.HttpParamsUtils;
import com.uphone.kingmall.utils.MyUrl;

/**
 * <pre>
 *     author : radish
 *     e-mail : 15703379121@163.com
 *     time   : 2019/3/28
 *     desc   :
 * </pre>
 */
public class AttentionSearchActivity extends BaseSearchListActivity<UserShopCollectBean, UserShopCollectBean.DataBean> {
    @Override
    protected void itemClick(BaseQuickAdapter adapter, View view, int position) {

        CommonUtil.startIntent(this, ShopDetailActivity.class, dataList.get(position).getShopId());
    }

    @Override
    protected BaseQuickAdapter initAdapter() {
        ll.setBackgroundColor(Color.WHITE);
        return new AttentionStoreAdapter();
    }

    @Override
    protected UserShopCollectBean getBeans() {
        return new UserShopCollectBean();
    }

    @Override
    protected HttpParams getParams() {
        HttpParams params = HttpParamsUtils.getInstance().put("page", page)
                .put("limit", 10).getParams();
        if (!CommonUtil.checkViewEmpty(etContent)) {
            params.put("keyword", etContent.getText().toString().trim());
        }
        return params;
    }

    @Override
    protected String getUrl() {
        return MyUrl.getUserCollectShops;
    }
}
